import request from "../utils/request";

export function permissionDict() {
    return request({
        url: "permission/permissionDict",
        method: 'get',
    })
}


export function permissionList(permissionDesc, currentPage, pageSize) {
    return request({
        url: "permission/permissions",
        method: 'get',
        params: {
            permissionDesc, currentPage, pageSize
        }
    })
}


export function getPermissionById(id) {
    return request({
        url: "permission/get/" + id,
        method: 'get',
    })
}

export function addPermission(bean) {
    return request({
        url: "permission/add",
        method: 'post',
        data: {
            ...bean
        }
    })
}

export function deletePermission(id) {
    return request({
        url: "permission/delete",
        method: 'post',
        data: {
            id
        }
    })
}

export function updatePermission(bean) {
    return request({
        url: "permission/update",
        method: 'post',
        data: {
            ...bean
        }
    })
}

export function exportPermission(ids) {
    return request({
        url: "permission/export",
        method: 'post',
        responseType: "blob",
        data: {
            ids
        }
    })
}
